using DslCrossModelFramework.ModelTraversal;
using Microsoft.VisualStudio.Modeling;

namespace DslCrossModelFramework.ModelRelationship {
    public class ModelElementProxyFilter<TProxyElementType> : ModelElementFilterBase where TProxyElementType : ICrossModelProxyElement {
        private TProxyElementType proxy;
        public ModelElementProxyFilter(TProxyElementType proxy) {
            this.proxy = proxy;
        }

        public override bool IsValid(ModelElement modelElement) {
            return proxy.IsValidTarget(modelElement);
        }
    }
}